<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="../css/common.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/article.css" media="all" />
</head>
<body>
<div id="w3h_body">
  <div class="body_content">
    <!-- toc begin -->
    <h1 class="title">BT9016: 只有 IE 和 Opera 支持 document.frames</h1>
    <ul class="toc">
      <li><a href="#standard_reference">标准参考</a> <span>•</span></li>
      <li><a href="#description">问题描述</a> <span>•</span></li>
      <li><a href="#influence">造成的影响</a> <span>•</span></li>
      <li><a href="#impacted_browsers">受影响的浏览器</a> <span>•</span></li>
      <li><a href="#analysis_of_issues">问题分析</a> <span>•</span></li>
      <li><a href="#solutions">解决方案</a> <span>•</span></li>
      <li><a href="#see_also">参见</a></li>
    </ul>
    <!-- toc end -->
    <div id="w3h_content">
      <!-- content begin -->
      <address class="author">作者：蔡美纯</address>
      <h2 id="standard_reference">标准参考</h2>
      <p>无。</p>
      <h2 id="description">问题描述</h2>
      <p>document.frames 只有 IE Opera 支持。等同于 window.frames。用来取得当前页面内 window 对象的集合。</p>

      <h2 id="influence">造成的影响</h2>
      <p>在 Firefox Chorome Safari 中使用 document.frames 不能获取到 FRAME 元素。</p>

      <h2 id="impacted_browsers">受影响的浏览器</h2>
      <table class="list">
        <tr>
          <th>IE6 IE7 IE8 Opera</th>
          <td></td>
        </tr>
      </table>

      <h2 id="analysis_of_issues">问题分析</h2>
      <p>分析以下代码：</p>
<pre>
&lt;iframe src=&quot;xxx.html&quot;&gt;&lt;/iframe&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
alert(!!document.frames);
&lt;/script&gt;
</pre>
      <p>在各浏览器输出如下：</p><table class="compare">
        <tr>
          <th>IE6 IE7 IE8 Opera</th>
          <th>Firefox Safari Chrome</th>
        </tr>
        <tr>
          <td>true</td>
          <td>false</td>
        </tr>
      </table>

      <h2 id="solutions">解决方案</h2>
      <p>用 window.frames 代替 document.frames。</p>

      <h2 id="see_also">参见</h2>
      <h3>知识库</h3>
      <ul class="see_also">
        <li><a href="#">...</a></li>
      </ul>

      <h3>相关问题</h3>
      <ul class="see_also">
        <li><a href="#">...</a></li>
      </ul>

      <div class="appendix">
        <h2>测试环境</h2>
        <table class="list">
          <tr>
            <th>操作系统版本:</th>
            <td>Windows 7 Ultimate build 7600</td>
          </tr>
          <tr>
            <th>浏览器版本:</th>
            <td> IE6<br />
              IE7<br />
              IE8<br />
              Firefox 3.6<br />
              Chrome 4.0.302.3 dev<br />
              Safari 4.0.4<br/>
              Opera 10.60
            </td>
              
          </tr>
          <tr>
            <th>测试页面:</th>
            <td>无</td>
          </tr>
          <tr>
            <th>本文更新时间:</th>
            <td>2010-06-25</td>
          </tr>
        </table>
        <h2>关键字</h2>  
        <!-- keywords begin -->
        <p>document frames window</p>
        <!-- keywords end -->
      </div>
      <!-- content end -->
    </div>
  </div>
</div>
</body>
</html>
